<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html;charset=utf-8">
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta content="always" name="referrer">
    <meta name="format-detection" content="telephone=no" />
    <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <title>提交资质材料</title>
    <link rel="stylesheet" href="/LianniuWeb/css/new/reset.css">
    <link rel="stylesheet" href="/LianniuWeb/css/new/build/css/layui.css"  media="all">
    <link rel="stylesheet" href="/LianniuWeb/css/new//webuploader.css" />
    <link rel="stylesheet" href="/LianniuWeb/css/new/post_demand.css">
    <link rel="stylesheet" href="/LianniuWeb/css/new/build/css/layui.css"  media="all">
    <link type="text/css" rel="stylesheet" href="/LianniuWeb/css/easydialog.css"/>
    <link type="text/css" rel="stylesheet" href="/LianniuWeb/css/jquery-ui.css"/>
    <link type="text/css" rel="stylesheet" href="/LianniuWeb/css/jquery.datetimepicker.css"/>
    <script type="text/javascript" src="/LianniuWeb/js/widget/easydialog.min.js"></script>
</head>
<body>
<div class="ranking_header">
    <div class="back_btn" onclick="history.back(-1)"></div>
    <p>提交资质材料</p>
</div>
<form class="layui-form">
    <div class="padding_both">
        <div class="phone_box">
            <span>姓名：</span>
            <input type="text" name="buyerName" placeholder="请输入您的真实姓名" id="buyerName" maxlength="16">
        </div>
        <div class="password_box">
            <span>手机号码：</span>
            <input type="text" name="buyerTel" placeholder="请输入您的手机号码" id="buyerTel" maxlength="11">
        </div>
        <div class="password_box">
            <span>公司名称：</span>
            <input type="text" name="compName" placeholder="请输入您的公司名称" id="compName" maxlength="32">
        </div>
        <div class="password_box" >
            <div class="img_box" style="display: none;" id="photoBox">
                <div class="img3" style="display: none;">
                    <span></span>
                    <img src="" id="cardFront">
                </div>
                <div class="img3" style="display: none;">
                    <span></span>
                    <img src="" id="cardBack">
                </div>
            </div>
            <div class="file-pick" id="filePicker">
                <span >添加图片</span>
                <div>
                    <p>1.请上传名片照片正反面各一张</p>
                    <p>2.名片照片内容务必清晰</p>
                </div>
            </div>
            <div id="upload" style="display: none;">
            </div>
        </div>
        <input type="button" value="提交" class="load_btn" id="btn">
    </div>
</form>
<script src="/LianniuWeb/js/underscore/underscore.js"></script>
<script src="/LianniuWeb/js/commons/commons.js"></script>
<script src="/LianniuWeb/js/commons/util.js"></script>
<script src="/LianniuWeb/js/jquery/jquery-1.11.3.min.js"></script>
<script type="text/javascript" src="/LianniuWeb/js/buyer/flexible.js"></script>
<script type="text/javascript" src="/LianniuWeb/js/demand/auth.js"></script>
<script src="/LianniuWeb/css/new/build/layui.js" charset="utf-8"></script>
<script src="/LianniuWeb/js/buyer/webuploader.js"></script>
<script src="/LianniuWeb/js/jquery/jquery.datetimepicker.js"></script>
    <script type="text/javascript">
    $("#filePicker").click(function(){
        $("#upload").find("input[type=file]").click();
    })
    // 初始化Web Uploader
    var uploader = WebUploader.create({

        // 选完文件后，是否自动上传。
        auto: true,
        // swf文件路径
        swf: '/js/Uploader.swf',

        // 文件接收服务端。
        server: '/LianniuWeb/rest/fileUpload/uploadPic.do?filepath=auth',

        // 选择文件的按钮。可选。
        // 内部根据当前运行是创建，可能是input元素，也可能是flash.
        pick: {id:'#upload',multiple:false},

        // 只允许选择图片文件。
        accept: {
            title: 'Images',
            extensions: 'gif,jpg,jpeg,bmp,png',
            mimeTypes: 'image/*'
        },
        compress:{
            width: 500,
            height: 550,

            // 图片质量，只有type为`image/jpeg`的时候才有效。
            quality: 40,

            // 是否允许放大，如果想要生成小图的时候不失真，此选项应该设置为false.
            allowMagnify: false,

            // 是否允许裁剪。
            crop: false,

            // 如果发现压缩后文件大小比原来还大，则使用原来图片
            // 此属性可能会影响图片自动纠正功能
            noCompressIfLarger: false,

            // 单位字节，如果图片大小小于此值，不会采用压缩。
            compressSize: 30 * 1024
        }
    });
    uploader.on( 'uploadSuccess', function( file,a,b ) {
        if($("#cardFront").attr("src") == "")
        {
            $("#photoBox").show()
            $("#cardFront").parent().show();
            $("#cardFront").attr("src", a.data);
            if($("#cardFront").attr("src") != ""
                    && $("#cardBack").attr("src") != "")
            {
                $("#filePicker").hide();
            }
            return;
        }
        if($("#cardBack").attr("src") == "")
        {
            $("#photoBox").show()
            $("#cardBack").parent().show();
            $("#cardBack").attr("src", a.data);
            if($("#cardFront").attr("src") != ""
                    && $("#cardBack").attr("src") != "")
            {
                $("#filePicker").hide();
            }
        }
    });

    uploader.on( 'uploadError', function( file ) {
        easyAlert("上传出错");
    });
</script>
<script>
    var _hmt = _hmt || [];
    (function() {
        var hm = document.createElement("script");
        hm.src = "https://hm.baidu.com/hm.js?867c800f411683d2a7fa9eb1eabd9736";
        var s = document.getElementsByTagName("script")[0];
        s.parentNode.insertBefore(hm, s);
    })();
</script>
</body>
</html>